from rest_framework import serializers
from .models import *

class CastingSerializer(serializers.ModelSerializer):
    inspector_name=serializers.CharField(source="inspector.username",read_only=True)
    inspector_title=serializers.CharField(source="inspector.title",read_only=True)
    reviewer_name=serializers.CharField(source="reviewer.username",read_only=True)
    reviewer_title=serializers.CharField(source="reviewer.title",read_only=True)
    class Meta:
        model = Casting
        fields = "__all__"
        
class CastingFilmSerializer(serializers.ModelSerializer):
    class Meta:
        model = CastingFilm
        fields = "__all__"
        
class CastingDefectSerializer(serializers.ModelSerializer):
    class Meta:
        model = CastingDefect
        fields = "__all__"
